/*
* Copyright (C) 2020 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/&gt;.
*
*/
#ifndef SHORTCUTPANELWIDGET_H
#define SHORTCUTPANELWIDGET_H
#include <QObject>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QDBusInterface>
#include <QDBusReply>
#include <QDebug>
#include <QPainterPath>

#include "accountinformation.h"
#include "scrollingareawidgetmajor.h"
#include "weatherwidget.h"
#include "../dbusmanager.h"
#include "quickoperationdbus.h"
#include "templatewidget.h"

#define MAJOR_QUICK_PANEL_HEIGHT 311
#define MAJOR_QUICK_PANEL_WIDTH  376

class PartLineWidget;

class shortcutPanelWidget : public QWidget
{
    Q_OBJECT

public:
    explicit shortcutPanelWidget(QObject *parent = nullptr);

    ScrollingAreaWidgetMajor*  m_pScrollingAreaWidgetMajor;    //声音亮度滑动条

private:
    //通用函数
    void initsetShortWidget();           //布局快捷按钮界面

    void initMemberVariablesMajor();     //初始化插件成员变量
    void initShortButtonWidgetMajor();   //初始化快捷按钮界面
    void setWidgetMajor();               //将切换按钮和ListView界面set进插件主界面
    void checkFunctionValid(QString function, QStringList &functionList);  //检测功能是否有效

    //通用变量
    QVBoxLayout*          m_pMainVLayout            = nullptr;  //主纵向布局
    QGridLayout*          m_pShortGLayout           = nullptr;  //快捷操作面板下半部分布局
    QWidget*              m_pShortWidget            = nullptr;  //快捷按钮群界面
    PartLineWidget*       m_PartLine                = nullptr;  //分割线1
    QList<QWidget*>       m_shortButtonWidgetList;              //保存按钮的列

};

class PartLineWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PartLineWidget(QWidget *parent = nullptr);
    void initStyle();
    void paintEvent(QPaintEvent *event);
    QString m_pStyleName;

};

#endif // SHORTCUTPANELWIDGET_H
